package cn.mastor.quartz;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class Test {
    @PostConstruct
    public void start() throws SchedulerException {
        LikeTask likeTask = new LikeTask();
        QuartzConfig config = new QuartzConfig();
        Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
        scheduler.scheduleJob(config.quartzDetail(), config.quartzTrigger());
        scheduler.start();
//        likeTask.executeInternal(new JobExecutionContextImpl(StdSchedulerFactory.getDefaultScheduler(),config.quartzTrigger(),config.quartzDetail()));
    }
}
